package com.ifugle.rap.application.service;

import java.util.List;
import com.ifugle.rap.application.api.UserMaterialApi;
import com.ifugle.rap.application.mapper.UserMaterialMapper;
import com.ifugle.rap.application.model.UserMaterial;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class UserMaterialService implements UserMaterialApi{

    @Autowired
    UserMaterialMapper userMaterialMapper;

    @Override
    public int deleteByPrimaryKey(Long id) {
        return userMaterialMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(UserMaterial record) {
        return userMaterialMapper.insert(record);
    }

    @Override
    public int insertSelective(UserMaterial record) {
        return userMaterialMapper.insertSelective(record);
    }

    @Override
    public UserMaterial selectByPrimaryKey(Long id) {
        return userMaterialMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<UserMaterial> selectByUserId(Long userId) {
        return userMaterialMapper.selectByUserId(userId);
    }

    @Override
    public int updateByPrimaryKeySelective(UserMaterial record) {
        return userMaterialMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(UserMaterial record) {
        return userMaterialMapper.updateByPrimaryKey(record);
    }

    @Override
    public UserMaterial selectByUserIdAndmaterialId(Long userId,Long materialId){
        return userMaterialMapper.selectByUserIdAndmaterialId(userId,materialId);
    }
}
